<?php

/**
 * MenuItem form.
 *
 * @package    ##PROJECT_NAME##
 * @subpackage form
 * @author     ##AUTHOR_NAME##
 * @version    SVN: $Id: sfPropelFormTemplate.php 10377 2008-07-21 07:10:32Z dwhittle $
 */
class MenuItemForm extends BaseMenuItemForm
{
	public function configure()
	{
		$this->widgetSchema['parent_id'] = new sfWidgetPropelLevels(array('method_get_root_group'=>'getMenu','model' => 'MenuItem','parent' => 'parent_id', 'add_empty' => '<< root >>','peer_method'=>'doSelect'));
		$this->validatorSchema['parent_id'] = new sfValidatorPropelLevels(array('model' => 'MenuItem', 'column' => 'id', 'required' => false));


		$c= new Criteria();
		$c->add(sfGuardPermissionPeer::ID , globals::$ALLOWD_TO_SEE_PERMISSIONS_IDS , Criteria::IN);
		
		$this->widgetSchema['menu_item_permission_list'] = new sfWidgetFormPropelChoiceMany(array('model' => 'sfGuardPermission' , 'criteria'=>$c));

		unset($this['created_by']);unset($this['created_at']);
	}
}
